﻿///***************************************************************
/// 시  스  템 : Updms.Etc.Dac
/// 단위시스템 : FIT
/// 계      층 : Data Access Layer
/// 프로그램명 : Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING
/// 파  일  명 : Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING.cs
/// 설      명 : 근력운동
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2014-05-21 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Fit.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING : Base.AppFramework.DacBase
	{
		public Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING()
		{
		}

		#region NT [GetSearchCount]
		/// <summary>
		/// 근력운동의 검색결과수를 카운트한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Get_Search_Count";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [SelectProcess]
		/// <summary>
		/// 근력운동을 조회한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_WEIGHT_TRAINING", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetTrainingResultByTrainingId]
		/// <summary>
		/// 운동수행결과
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetTrainingResultByTrainingId(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_REPORT_Fit3011p_Get_Training_Result_By_Training_Id";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_REPORT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetMonthlyTrainingResult]
		/// <summary>
		/// 운동수행캘린더(월별)
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetMonthlyTrainingResult(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_REPORT_Fit2011r_Get_Monthly_Training_Result";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_REPORT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetTotalFitnessSummary]
		/// <summary>
		/// 종합건강요약
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetTotalFitnessSummary(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_REPORT_Fit2012r_Get_Total_Fitness_Summary";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_REPORT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetMonthlyTotalResultByTrainingPartNType]
		/// <summary>
		/// 월별 운동부위별 운동별 트레이닝 결과
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetMonthlyTotalResultByTrainingPartNType(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_REPORT_Fit3012p_Get_Monthly_Total_Result_By_Training_Part_N_Type";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_REPORT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetWeightTrainingAnalysisComparedMonth]
		/// <summary>
		/// 월별대비분석표
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetWeightTrainingAnalysisComparedMonth(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_REPORT_Fit2013r_Get_Weight_Training_Analysis_Compared_Month";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_REPORT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetTrainingIdList]
		/// <summary>
		/// 트레이닝아이디 목록조회 - 트레이닝아이디 수정용
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetTrainingIdList(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Get_Training_Id_List";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_WEIGHT_TRAINING", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion


		#region RT [Insert]
		/// <summary>
		/// 근력운동을 저장한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Update]
		/// <summary>
		/// 근력운동을 수정한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Update";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Delete]
		/// <summary>
		/// 근력운동을 삭제한다.
		/// </summary>
		/// <param name="ls_xml"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [ChangeTrainingId]
		/// <summary>
		/// 트레이닝아이디 변경
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int ChangeTrainingId(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_Change_Training_Id";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

	}
}
